package org.linlinjava.litemall.db.dto;

import org.linlinjava.litemall.db.domain.AgedmallStore;
import org.linlinjava.litemall.db.domain.LitemallOrder;

import java.math.BigDecimal;

public class UserAddressInfo {
    private String province;
    private String city;
    private String village;
    private String userName;
    private Integer gender;
    private String phone;
    private Integer isDefault;
    private String address;
    private String detail;
    private BigDecimal lng;
    private BigDecimal lat;
    private Integer isHos;
    private Integer hosId;
    private String hosName;

    public static UserAddressInfo getInstance(LitemallOrder order) {
        UserAddressInfo userAddressInfo = new UserAddressInfo();
        userAddressInfo.setProvince(order.getProvince());
        userAddressInfo.setCity(order.getCity());
        userAddressInfo.setVillage(order.getCounty());
        userAddressInfo.setUserName(order.getConsignee());
        userAddressInfo.setPhone(order.getMobile());
        userAddressInfo.setAddress(order.getAddress());
        userAddressInfo.setDetail(order.getAddressDetail());
        userAddressInfo.setLng(order.getLng());
        userAddressInfo.setLat(order.getLat());
        userAddressInfo.setIsHos(order.getIsHospital());
        userAddressInfo.setHosId(order.getHospitalId());
        userAddressInfo.setHosName(order.getHospitalName());
        return userAddressInfo;
    }

    public static UserAddressInfo getInstance(AgedmallStore store) {
        UserAddressInfo userAddressInfo = new UserAddressInfo();
        userAddressInfo.setProvince(store.getProvinceName());
        userAddressInfo.setCity(store.getCityName());
        userAddressInfo.setVillage(store.getAreaName());
        userAddressInfo.setUserName(store.getUserName());
        userAddressInfo.setPhone(store.getPhone());
        userAddressInfo.setAddress(store.getAddressDetail());
        userAddressInfo.setDetail(store.getProvinceName() + store.getCityName() + store.getAreaName() + store.getAddressDetail());
        userAddressInfo.setLng(store.getLng());
        userAddressInfo.setLat(store.getLat());
        return userAddressInfo;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getVillage() {
        return village;
    }

    public void setVillage(String village) {
        this.village = village;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getIsDefault() {
        return isDefault;
    }

    public void setIsDefault(Integer isDefault) {
        this.isDefault = isDefault;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public BigDecimal getLng() {
        return lng;
    }

    public void setLng(BigDecimal lng) {
        this.lng = lng;
    }

    public BigDecimal getLat() {
        return lat;
    }

    public void setLat(BigDecimal lat) {
        this.lat = lat;
    }

    public Integer getIsHos() {
        return isHos;
    }

    public void setIsHos(Integer isHos) {
        this.isHos = isHos;
    }

    public Integer getHosId() {
        return hosId;
    }

    public void setHosId(Integer hosId) {
        this.hosId = hosId;
    }

    public String getHosName() {
        return hosName;
    }

    public void setHosName(String hosName) {
        this.hosName = hosName;
    }
}
